package pro.shushi.pamirs.hr.core.hook;

import org.springframework.stereotype.Component;
import pro.shushi.pamirs.hr.api.HrSimpleModule;
import pro.shushi.pamirs.hr.core.session.HrSimpleSessionCache;
import pro.shushi.pamirs.meta.annotation.Hook;
import pro.shushi.pamirs.meta.api.core.faas.HookBefore;
import pro.shushi.pamirs.meta.api.dto.fun.Function;

@Component
public class HrSimpleSessionHook implements HookBefore {

    /**
     * 模块Session拦截
     * @param function
     * @param args
     * @return
     */
    @Override
    @Hook(priority = 1, module = HrSimpleModule.MODULE_MODULE)
    public Object run(Function function, Object... args) {
        HrSimpleSessionCache.init();
        return function;
    }

}
